

#ifndef __C_PLANAR_SHADOW_
#define __C_PLANAR_SHADOW_

#include "IrrCompileConfig.h"
#ifdef _IRR_PSP_
#include <GL/gl.h>

namespace irr
{
    namespace scene
    {
        class CPlanarShadow : public ISceneNode
        {

        public:
            CPlanarShadow(scene::ISceneNode *parent, scene::ISceneManager *mgr, IMesh* mesh, float divisor);
            ~CPlanarShadow();


            void setPlane(core::plane3df plane);
            void setAnimated(bool animated);
            void setMeshToRenderFrom(IMesh* mesh);
            void setTransform(core::matrix4& transform);

            void buildMesh(IMesh* mesh);
            void setDepth(bool DepthTest);


            //! pre render method
            virtual void OnPreRender();

            //! renders the node.
            virtual void render();

            //! returns the axis aligned bounding box of this node
            virtual const core::aabbox3d<f32>& getBoundingBox() const;

            //! returns the material based on the zero based index i.
            virtual video::SMaterial& getMaterial(s32 i);

            //! returns amount of materials used by this scene node.
            virtual s32 getMaterialCount();

            //! Returns type of the scene node
            virtual ESCENE_NODE_TYPE getType() {
                return ESNT_PLANAR_SHADOW;
            }


        private:
            bool Animated;
            core::plane3df Plane;
            core::matrix4 Transform;
            bool enableDepth;

            core::vector3df *Vertices;
            u16* Indices;

            int IndexCount;
            int VertexCount;

            scene::ISceneManager*SceneManager;
            float Divisor;

            core::aabbox3d<f32> Box;
            core::matrix4 View;

        };
    }
}

#endif

#endif